import com.sun.media.jfxmedia.locator.LocatorCache;

import java.time.DayOfWeek;
import java.time.LocalDate;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2023-02-20
 * Time: 16:18
 */
 class TestDemo {
    public static void main(String[] args) {
        int []months = new int[]{0,31,28,31,30,31,30,31,31,30,31,30,31};
        LocalDate begin = LocalDate.of(2000,1,1);
        LocalDate end = LocalDate.of(2020,10,1);
        long day = end.toEpochDay() - begin.toEpochDay();
        int count = 0;
        LocalDate plus = begin;
        for(int i=1;i<=day;i++){
            plus = plus.plusDays(1);
            if(plus.getDayOfWeek().equals(DayOfWeek.MONDAY) || plus.getDayOfMonth() == 1){
                count++;
            }
        }
        long total = day + count;
        System.out.println(total);
    }
}


public class Main {
    public static void main(String[] args) {
        int []months = new int[]{0,31,28,31,30,31,30,31,31,30,31,30,31};
        int week = 6;
        int cnt = 0;
        for(int i=2000; ;i++){
            if((i%4==0&&i%100!=0) || (i%400==0)){
                months[2]=29;
            }else {
                months[2]=28;
            }

            for(int j=1;j<=12;j++){
                for(int k=1;k<=months[j];k++){
                    cnt++;
                    if(week==8){
                        week = 1;
                    }
                    if(week == 1 || k==1){
                        cnt++;
                    }
                    week++;
                    if(i==2020 && j==10 && k==1){
                        System.out.printf("%d",cnt);
                        return ;
                    }
                }
            }
        }
    }
}